package com.qufadai.framework.orm.jdbc;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * Define query conditions
 */
public class QueryDefinition {
    private String key;
    private String constraint;
    private Set<String> columns = new HashSet<String>();
    private Map<String,String> conditions = new HashMap<String, String>();
    
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
    public Set<String> getColumns() {
        return columns;
    }
    public void setColumns(Set<String> columns) {
        this.columns = columns;
    }
    public Map<String, String> getConditions() {
        return conditions;
    }
    public void setConditions(Map<String, String> conditions) {
        this.conditions = conditions;
    }
    public String getConstraint() {
        return constraint;
    }
    public void setConstraint(String constraint) {
        this.constraint = constraint;
    }
    
    public void addColumn(String column) {
        columns.add(column);
    }
    
    public void addColumns(String[] cols) {
        for(int i = 0; i < cols.length; i++) {
            columns.add(cols[i]);
        }
    }
}
